Imports System.ComponentModel
Imports DotNetNuke.UI.WebControls
Imports Aricie.DNN.UI.WebControls.EditControls

Namespace Aricie.DNN.Caching.Client.Memcached

    Public Enum NodeLocator
        DefaultLocator
        SingleNode
    End Enum

    Public Enum KeyTransformer
        DefaultKeyTransformer
        Base64
        Sha1
        TigerHash
    End Enum

    <Serializable()> _
    Public Class MemcachedClusterSettings
        Inherits CachingClusterSettings


        Private _NodeLocator As NodeLocator
        Private _KeyTransformer As KeyTransformer
        'Private _ConnectionTimeOut As New STimeSpan(TimeSpan.FromSeconds(10))
        Private _DeadTimeOut As New STimeSpan(TimeSpan.FromSeconds(30))
        Private _ReceiveTimeOut As New STimeSpan(TimeSpan.FromSeconds(10))
        Private _MinPoolSize As Integer = 10
        Private _MaxPoolSize As Integer = 100

        <Category("MemcachedSettings")> _
        Public Property NodeLocator() As NodeLocator
            Get
                Return _NodeLocator
            End Get
            Set(ByVal value As NodeLocator)
                _NodeLocator = value
            End Set
        End Property

        <Category("MemcachedSettings")> _
        Public Property KeyTransformer() As KeyTransformer
            Get
                Return _KeyTransformer
            End Get
            Set(ByVal value As KeyTransformer)
                _KeyTransformer = value
            End Set
        End Property


        '<Category("MemcachedSettings")> _
        '    <Editor(GetType(PropertyEditorEditControl), GetType(EditControl))> _
        '   <LabelMode(LabelMode.Top)> _
        'Public Property ConnectionTimeOut() As STimeSpan
        '    Get
        '        Return _ConnectionTimeOut
        '    End Get
        '    Set(ByVal value As STimeSpan)
        '        _ConnectionTimeOut = value
        '    End Set
        'End Property

        <Category("MemcachedSettings")> _
          <Editor(GetType(PropertyEditorEditControl), GetType(EditControl))> _
         <LabelMode(LabelMode.Top)> _
      Public Property ReceiveTimeOut() As STimeSpan
            Get
                Return _ReceiveTimeOut
            End Get
            Set(ByVal value As STimeSpan)
                _ReceiveTimeOut = value
            End Set
        End Property

        <Category("MemcachedSettings")> _
          <Editor(GetType(PropertyEditorEditControl), GetType(EditControl))> _
         <LabelMode(LabelMode.Top)> _
      Public Property DeadTimeOut() As STimeSpan
            Get
                Return _DeadTimeOut
            End Get
            Set(ByVal value As STimeSpan)
                _DeadTimeOut = value
            End Set
        End Property

        <Category("MemcachedSettings")> _
            <Required(True)> _
        Public Property MinPoolSize() As Integer
            Get
                Return _MinPoolSize
            End Get
            Set(ByVal value As Integer)
                _MinPoolSize = value
            End Set
        End Property

        <Category("MemcachedSettings")> _
           <Required(True)> _
       Public Property MaxPoolSize() As Integer
            Get
                Return _MaxPoolSize
            End Get
            Set(ByVal value As Integer)
                _MaxPoolSize = value
            End Set
        End Property


    End Class
End Namespace